/**
 * Copyright (c) 2015-2016, Michael Yang 杨福海 (fuhai999@gmail.com).
 *
 * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.gnu.org/licenses/lgpl-3.0.txt
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.wzgl.core.baseModel;

import com.jfinal.plugin.activerecord.IBean;
import com.jfinal.plugin.ehcache.CacheKit;
import com.jfinal.plugin.ehcache.IDataLoader;
import com.wzgl.core.base.JModel;
import com.wzgl.message.MessageKit;

/**
 *  Auto generated by JPress, do not modify this file.
 */
@SuppressWarnings("serial")
public abstract class BaseGirdResult<M extends BaseGirdResult<M>> extends JModel<M> implements IBean {

	public static final String CACHE_NAME = "grid_result";
	public static final String METADATA_TYPE = "grid_result";

	public static final String ACTION_ADD = "grid_result:add";
	public static final String ACTION_DELETE = "grid_result:delete";
	public static final String ACTION_UPDATE = "grid_result:update";
	
	public void removeCache(Object key){
		if(key == null) return;
		CacheKit.remove(CACHE_NAME, key);
	}

	public void putCache(Object key,Object value){
		CacheKit.put(CACHE_NAME, key, value);
	}

	public M getCache(Object key){
		return CacheKit.get(CACHE_NAME, key);
	}

	public M getCache(Object key,IDataLoader dataloader){
		return CacheKit.get(CACHE_NAME, key, dataloader);
	}



	@Override
	public boolean equals(Object o) {
		if(o == null){ return false; }
		if(!(o instanceof BaseGirdResult<?>)){return false;}

		BaseGirdResult<?> m = (BaseGirdResult<?>) o;
		if(m.getFid() == null){return false;}

		return m.getFid().compareTo(this.getFid()) == 0;
	}

	@Override
	public boolean save() {
		boolean saved = super.save();
		if (saved) { MessageKit.sendMessage(ACTION_ADD, this); }
		return saved;
	}

	@Override
	public boolean delete() {
		boolean deleted = super.delete();
		if (deleted) { MessageKit.sendMessage(ACTION_DELETE, this); }
		return deleted;
	}

	@Override
	public boolean deleteById(Object idValue) {
		boolean deleted = super.deleteById(idValue);
		if (deleted) { MessageKit.sendMessage(ACTION_DELETE, this); }
		return deleted;
	}

	@Override
	public boolean update() {
		boolean update = super.update();
		if (update) { MessageKit.sendMessage(ACTION_UPDATE, this); }
		return update;
	}

	public void setFid(java.lang.String id) {
		set("fid", id);
	}

	public java.lang.String getFid() {
		Object id = get("fid");
		if (id == null)
			return null;
		return id.toString();
	}

	public java.lang.String getFuserId() {
		return get("fuserId");
	}

	public void setFuserId(java.lang.String fuserId) {
		set("fuserId", fuserId);
	}

	public java.lang.Integer getFstatus() {
		return get("fstatus");
	}

	public void setFstatus(java.lang.Integer fstatus) {
		set("fstatus",fstatus);
	}

	public java.lang.String getFtitle() {
		return get("ftitle");
	}

	public void setFtitle(java.lang.String ftitle) {
		set("ftitle",ftitle);
	}

	public java.lang.String getFdescribe() {
		return get("fdescribe");
	}

	public void setFdescribe(java.lang.String fdescribe) {
		set("fdescribe",fdescribe);
	}

	public java.lang.String getFtype() {
		return get("ftype");
	}

	public void setFtype(java.lang.String ftype) {
		set("ftype",ftype);
	}

	public java.lang.String getFhtml() {
		return get("fhtml");
	}

	public void setFhtml(java.lang.String fhtml) {
		set("fhtml",fhtml);
	}

	public java.lang.String getFtext() {
		return get("ftext");
	}

	public void setFtext(java.lang.String ftext) {
		set("ftext",ftext);
	}

	public java.lang.String getFormttext() {
		return get("formttext");
	}

	public void setFormttext(java.lang.String formttext) {
		set("formttext",formttext);
	}

	public java.lang.String getFaddress() {
		return get("faddress");
	}

	public void setFaddress(java.lang.String faddress) {
		set("faddress",faddress);
	}

	public java.lang.String getFcontact() {
		return get("fcontact");
	}

	public void setFcontact(java.lang.String fcontact) {
		set("fcontact",fcontact);
	}

	public java.lang.String getFcoverImg() {
		return get("fcoverImg");
	}
	public void setFcoverImg(java.lang.String fcoverImg) {
		set("fcoverImg",fcoverImg);
	}
	
	public java.lang.String getFcoverImg2() {
		return get("fcoverImg2");
	}
	public void setFcoverImg2(java.lang.String fcoverImg2) {
		set("fcoverImg2",fcoverImg2);
	}

	public java.util.Date getFdate() {
		return get("fdate");
	}

	public void setFdate(java.util.Date fdate) {
		set("fdate",fdate);
	}
	
	public java.lang.String getFgetDate() {
		return get("fgetDate");
	}
	public void setFgetDate(java.lang.String fgetDate) {
		set("fgetDate", fgetDate);
	}
	
	public java.lang.String getFsenddate() {
		return get("fsenddate");
	}
	public void setFsenddate(java.lang.String fsenddate) {
		set("fsenddate", fsenddate);
	}
	
	public void setFmzgicId(String fmzgicId){
	    	set("fmzgicId",fmzgicId);
    }
    public String getFmzgicId(){
    	return get("fmzgicId");
    }
    
    public void setFcounts(Integer fcounts){
    	set("fcounts",fcounts);
    }
    public Integer getFcounts(){
    	return get("fcounts");
    }
    
    public void setFareadySend(String string){
    	set("fareadySend",string);
    }
    public Integer getFareadySend(){
    	return get("fareadySend");
    }
    
    public void setFfrom(String ffrom){
    	set("ffrom",ffrom);
    }
    public String getFfrom(){
    	return get("ffrom");
    }
}
